<?php
include_once('common.inc.php');
$tmp_str = @file_get_contents("php://input");
$ext = $_GET['ext'];
if( !empty($tmp_str) ){
	$path = __UPLOAD__.'product/';
	$filename = time().'.'.$ext;
	$handle = fopen( $path.$filename, "w" );
	if( fwrite($handle,$tmp_str) === false ){
		echo "Failed";
	}else{
		echo UPLOAD_URL."/product/$filename";
	}
	fclose($handle);
}
